/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.ages.devtools

import com.ages.env.AbstractWorld
import com.ages.env.GLWindow
import java.awt.Color
import java.awt.Component
import java.awt.Frame
import java.awt.Panel
import java.awt.event.WindowAdapter
import java.awt.event.WindowEvent
import java.awt.List
import scala.collection.mutable.ArrayBuffer

class ModelWindow(name:String,world:AbstractWorld,width:Int,height:Int,components:ArrayBuffer[(Component,String)])
extends GLWindow(name,world,width,height){

override def setupFrame{

  canvas.setSize(width-200, height-100)
  frame.add(canvas,java.awt.BorderLayout.EAST)
//  frame.add(lst,"West")
  for((comp,layout)<-components)
    {
      frame.add(comp, layout)
    }
  frame.setSize(width, height)
  frame.setBackground(Color.GRAY)
  frame.setVisible(true)
//    frame.show
  frame.addWindowListener(new WindowAdapter() {
      override def windowClosing(e:WindowEvent) {
        System.exit(0)
      }
    })
//  panel.setVisible(true)

  }

//  val panel = new Panel()
//  panel.setBounds(100, 100, width-100, height-100)
//  panel.add("East",canvas)
//  canvas.setBounds(0, 0, width-100, height-100)
  
  def addComponent(c:Component)
  {
    this.frame.add(c)
  }

}
